<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DiscMaster.Web.Models.CourseLayout>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	EditLayout
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h1>Edit Layout @ <%= Model.Course.name %></h1>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

    <%= Html.LabelFor(cl=>cl.name) %>
    <%= Html.EditorFor(cl=>cl.name) %>
    <table>
        <tr>
            <td>hole</td>
            <td>par</td>
            <td>length</td>
        </tr>
   <% foreach (DiscMaster.Web.Models.Hole hole in Model.Holes.OrderBy(o=>o.number))
      {
       %>
        <% Html.RenderPartial("~/Areas/Courses/Views/Courses/EditorTemplates/hole.ascx", hole); %>
       <%
      } %>
    </table>
   <input type="submit" value="Save changes" />
<% } %>
</asp:Content>
